package ModelLayer;

import java.util.ArrayList;

public class Landlord extends People {

	private BankAccount bankAccount = new BankAccount();
	private ArrayList<Apartment> apartments = new ArrayList<>();

	public Landlord() {
		super();
	}

	public Landlord(int pid, String fname, String lname, String address,
			String city, String postalCode, String country, String phone,
			String email) {
		super(pid, fname, lname, address, city, postalCode, country, phone,
				email);

	}

	public Landlord(int pid, String fname, String lname, String address,
			String city, String postalCode, String country, String phone,
			String email, BankAccount bankAccount) {
		this(pid, fname, lname, address, city, postalCode, country, phone, email);
		this.bankAccount = bankAccount;
	}

	public ArrayList<Apartment> getApartments() {
		return apartments;
	}

	public void setApartments(ArrayList<Apartment> apartments) {
		this.apartments = apartments;
	}

	public void addApartment(Apartment newApartment) {
		apartments.add(newApartment);
	}

	public void deleteApartment(int apartNo) {
		for (Apartment apart : apartments)
			if (apart.getApartNo() == apartNo)
				apartments.remove(apart);
	}

	public BankAccount getBankAccount() {
		return bankAccount;
	}

	public void setBankAccount(BankAccount bankAccount) {
		this.bankAccount = bankAccount;
	}

}
